[#escape x as (x)!?html]
  <!-- 图书馆首页特有的头部内容 -->
  <div class="library-hero">
    <!-- 轮播图区域 -->
    <div id="carouselCaptions" class="carousel slide carousel-fade" data-ride="carousel">
      <ol class="carousel-indicators">
        <li data-target="#carouselCaptions" data-slide-to="0" class="active"></li>
        <li data-target="#carouselCaptions" data-slide-to="1"></li>
        <li data-target="#carouselCaptions" data-slide-to="2"></li>
        <li data-target="#carouselCaptions" data-slide-to="3"></li>
        <li data-target="#carouselCaptions" data-slide-to="4"></li>
      </ol>
      <div class="carousel-inner rounded-sm">
        <div class="carousel-item active">
          <img src="${files}/img/slide1.jpg" class="d-block w-100" alt="图书馆服务">
          <div class="carousel-caption d-none d-md-block">
            <p>图书馆综合服务平台</p>
          </div>
        </div>
        <div class="carousel-item">
          <img src="${files}/img/slide2.jpg" class="d-block w-100" alt="数字资源">
          <div class="carousel-caption d-none d-md-block">
            <p>海量数字资源</p>
          </div>
        </div>
        <div class="carousel-item">
          <img src="${files}/img/slide3.jpg" class="d-block w-100" alt="阅读空间">
          <div class="carousel-caption d-none d-md-block">
            <p>舒适阅读环境</p>
          </div>
        </div>
        <div class="carousel-item">
          <img src="${files}/img/slide4.jpg" class="d-block w-100" alt="学术支持">
          <div class="carousel-caption d-none d-md-block">
            <p>专业学术服务</p>
          </div>
        </div>
        <div class="carousel-item">
          <img src="${files}/img/slide5.jpg" class="d-block w-100" alt="文化活动">
          <div class="carousel-caption d-none d-md-block">
            <p>丰富的文化活动</p>
          </div>
        </div>
      </div>
      <a class="carousel-control-prev" href="#carouselCaptions" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="carousel-control-next" href="#carouselCaptions" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
      </a>
      <script>$('.carousel').carousel();</script>
    </div>

    <div class="container">
      <!-- 顶部信息栏 -->
      <div class="library-top-bar">
        <div class="row justify-content-between align-items-center">
          <div class="col-md-6">
            <div class="library-info">
              <h1 class="library-title">
                <img src="${site.logo!'${files}/img/logo.png'}" alt="${site.name}" class="library-logo">
                ${site.name}图书馆
              </h1>
            </div>
          </div>
          <div class="col-md-6 text-md-right">
            <div class="library-hours">
              <i class="far fa-clock"></i>
              开放时间：8:00 - 22:30
            </div>
            <div class="library-actions">
              [#if user??]
                <a href="${def}${user.homepage}" class="btn btn-outline-light btn-sm">
                  <i class="fas fa-user"></i> 个人中心
                </a>
                <form action="${ctx}/logout" method="post" class="d-inline">
                  <button type="submit" class="btn btn-outline-light btn-sm">
                    <i class="fas fa-sign-out-alt"></i> 退出
                  </button>
                  <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}">
                </form>
              [#else]
                <a href="${def}/login" class="btn btn-outline-light btn-sm">
                  <i class="fas fa-sign-in-alt"></i> 登录
                </a>
              [/#if]
            </div>
          </div>
        </div>
      </div>

      <!-- 主导航菜单 -->
      <nav class="library-nav">
        <ul class="nav justify-content-center">
          <li class="nav-item">
            <a class="nav-link[#if !channel?? && !channelAlias??] active[/#if]" href="${dy}/">
              <i class="fas fa-home"></i> 首页
            </a>
          </li>
          [@ChannelList isNav='true' offset='0'; list]
            [#list list as item]
              <li class="nav-item">
                <a class="nav-link[#if (channel?? && channel.paths[0].id == item.id) || (channelAlias?? && channelAlias == item.alias)] active[/#if]"
                   href="${item.url}"[#if item.targetBlank] target="_blank"[/#if]>
                  [#if item.customAttribute?? && item.customAttribute.icon??]
                    <i class="${item.customAttribute.icon}"></i>
                  [#else]
                    <i class="fas fa-file-alt"></i>
                  [/#if]
                  ${item.name}
                </a>
              </li>
            [/#list]
          [/@ChannelList]
        </ul>
      </nav>

      <!-- 核心搜索区域 -->
      <div class="library-search-section">
        <h2 class="search-title">文献数据一站式检索和全文获取</h2>
        <div class="search-tabs">
          <div class="btn-group" role="group">
            <button type="button" class="btn btn-outline-light[#if !searchType?? || searchType == 'all'] active[/#if]" data-search-type="all">全部</button>
            <button type="button" class="btn btn-outline-light[#if searchType?? && searchType == 'chinese'] active[/#if]" data-search-type="chinese">中文检索</button>
            <button type="button" class="btn btn-outline-light[#if searchType?? && searchType == 'foreign'] active[/#if]" data-search-type="foreign">外文检索</button>
          </div>
        </div>
        <form class="search-form" action="${dy}/search" method="get">
          <div class="input-group">
            <div class="input-group-prepend">
              <select class="form-control" name="searchField">
                <option value="all">全部字段</option>
                <option value="title">标题</option>
                <option value="author">作者</option>
                <option value="keyword">关键词</option>
                <option value="abstract">摘要</option>
              </select>
            </div>
            <input type="text" class="form-control search-input" name="q" placeholder="输入检索词..." value="${Params.q!''}">
            <div class="input-group-append">
              <button class="btn btn-warning search-btn" type="submit">
                <i class="fas fa-search"></i> 搜索
              </button>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
[/#escape]
